<script setup>
import {ref,onMounted} from 'vue'
import {useRoute} from "vue-router"
const tb=ref()
console.log("eltable",tb)
let route=useRoute()
console.log(route.query)
function onInit(table){
  //table.params.username='张三'
}
function test(data){
  alert(JSON.stringify(data))
}
function rd(...args){
  console.log(args)
  return "--aa"
}
</script>
<template>
  <DataTable url="userOperation/list" @init="onInit" ref="tb" pageable>
    <template #search="table">
      <Input type="text" v-model="table.params.username" placeholder="用户名"/>
      <Input type="text" v-model="table.params.name" placeholder="姓名"/>
    </template>
    <template #tools="table">
      <Button icon="jeicon-add" color="primary">添加</Button>
      <Button icon="h-icon-edit" text-color="primary">修改</Button>
      <Button icon="h-icon-trash" text-color="red">删除</Button>
      <Button icon="jeicon-add" color="primary">添加</Button>
    </template>
    <template #default="table">
      <ElTable :data="table.data" v-loading="table.loading" border  style="width: 100%;height: 100%">
        <el-table-column type="selection" selectable width="55" />
        <ElTableColumn prop="_index" label="序" width="180" />
        <ElTableColumn prop="operate" label="操作" width="180" />
        <ElTableColumn prop="user" label="用户" />
      </ElTable>
<!--      <Table :datas="table.data" :loading="table.loading"  checkbox>-->
<!--        <TableItem title="序号1" prop="_index"  :width="50">-->
<!--        </TableItem>-->
<!--        <TableItem title="用户名" prop="username"></TableItem>-->
<!--        <TableItem title="姓名" prop="name"></TableItem>-->
<!--        <TableItem title="手机号" prop="phone" :width="120"></TableItem>-->
<!--        <TableItem title="性别" prop="gender" dict="Gender" :width="50"></TableItem>-->
<!--        <TableItem title="控制">-->
<!--          <template #default="{data}">-->
<!--            <LinkButtons>-->
<!--              <Button>审核</Button>-->
<!--              <Button disabled>审核</Button>-->
<!--              <span>详情</span>-->
<!--              <span>详情</span>-->
<!--              <span>详情</span>-->
<!--              <Button>编辑</Button>-->
<!--              <Button disabled>编辑</Button>-->
<!--              <Button>编辑</Button>-->
<!--              <span @click="test(data)">修改密码</span>-->
<!--            </LinkButtons>-->
<!--          </template>-->
<!--        </TableItem>-->
<!--      </Table>-->
    </template>
  </DataTable>
</template>
